﻿using SH.Common.CommonReturn;
using SH.Multitenant.Domain.RBAC;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace SH.Multitenant.Application.IServices.IPermission
{
    public interface IPermissionServices : IBaseServices<Permission>
    {
        //根据用户获取菜单权限
        List<MenuDTO> GetMenusByEId(string? empId, string? parentId = "Top");
        //根据地址获取当前用户当前地址的按钮权限
        Task<List<Permission>> GetButtonPermissionsByPathAsync(string? empId, string? path);

        //获取所有的权限树形
        List<MenuDTO> GetAllMenus();
        //根据角色id获取角色权限
        List<Permission> GetPermissionsByRoleId(int roleId);
        //修改角色权限
        int UpdRolePermissions(int roleId, string? pIds);

        //根据父级编号获取权限列表
        Task<List<string>> GetSubPermissionsByParentId(string? parentId);

        //根据权限编号获取父级编号
        Task<string> GetParentIdByPId(string? pId);

        //判断该用户是否有资源对应的权限
        Task<bool> DeterminesWhetherHasThisPermissionAsync(string empId, string path);

        //多条件分页获取权限列表
        Task<ApiPaging<List<Permission>>> GetCondtionPagingPermissionList(string? pName, int pageSize, int pageIndex);
    }
}
